VERSION 5.00
Begin VB.Form frmLang 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4680
   ClipControls    =   0   'False
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdExit 
      Cancel          =   -1  'True
      Caption         =   "Command1"
      Height          =   495
      Left            =   2280
      TabIndex        =   3
      Top             =   1320
      Width           =   1215
   End
   Begin VB.CommandButton cmdSelect 
      Caption         =   "Command1"
      Default         =   -1  'True
      Height          =   495
      Left            =   720
      TabIndex        =   2
      Top             =   1320
      Width           =   1215
   End
   Begin VB.ComboBox cboLang 
      Height          =   315
      Left            =   1800
      Sorted          =   -1  'True
      Style           =   2  'Dropdown List
      TabIndex        =   1
      Top             =   840
      Width           =   2415
   End
   Begin VB.Label lblLang 
      Height          =   495
      Left            =   720
      TabIndex        =   0
      Top             =   360
      Width           =   3615
      WordWrap        =   -1  'True
   End
End
Attribute VB_Name = "frmLang"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private files() As String
Private PrevLang As String



Private Sub cboLang_click()
LoadLang (files(cboLang.ListIndex))
Init
End Sub

Private Sub cmdExit_Click()
If PrevLang <> "" Then
Settings.Language = PrevLang
LoadLang (LangPath & Settings.Language)
Unload Me
Else
MsgBox lang.Messages(87), vbInformation, lang.Messages(88)
cboLang.SetFocus
End If
End Sub

Private Sub cmdSelect_Click()

LoadLang (files(cboLang.ListIndex))
Settings.Language = cboLang.List(cboLang.ListIndex)
Init
Unload Me
End Sub

Private Sub Form_Load()
Dim i As Byte

Init
files = FileList(App.Path & "\lang")

For i = 0 To UBound(files)
cboLang.AddItem Capitalize(FileNoExt(FileNameOnly(files(i))))
Next i
cboLang.ListIndex = CheckLang("English")
PrevLang = Settings.Language
End Sub

Public Function CheckLang(ForWhat As String) As Byte
Dim i As Byte

For i = 0 To UBound(files)
If ForWhat = Capitalize(FileNoExt(FileNameOnly(files(i)))) Then
CheckLang = i
Exit Function
End If
Next i

End Function

Private Sub Init()

frmLang.Caption = lang.Messages(3)
lblLang.Caption = lang.Messages(4)
cmdSelect.Caption = lang.Buttons(0)
cmdExit.Caption = lang.Buttons(3)

End Sub

